package edu.scau.mis.core.utils;

public class Result {
    private String msg;
    private Object data;

    public static Result succ(){
        return succ("操作成功", null);
    }

    public static Result succ(String msg){
        return succ(msg, null);
    }

    public static Result succ(Object data) {
        return succ("操作成功", data);
    }

    public static Result succ(String msg, Object data) {
        Result r = new Result();
        r.setMsg(msg);
        r.setData(data);
        return r;
    }

    public static Result fail(){
        return succ("操作失败", null);
    }

    public static Result fail(String msg){
        return succ(msg, null);
    }

    public static Result fail(Object data) {
        return succ("操作失败", data);
    }

    public static Result fail(String msg, Object data) {
        Result r = new Result();
        r.setMsg(msg);
        r.setData(data);
        return r;
    }


    public String getMsg(){
        return msg;
    }

    public void setMsg(String msg){
        this.msg = msg;
    }

    public Object getData(){
        return data;
    }

    public void setData(Object data){
        this.data = data;
    }
}
